export default function getCascaderPath(value, array) {
  const result = [];
  for (const Obj of array) {
    result.push(Obj.value);
    if (Obj.value === value) {
      break;
    } else if (Obj.children) {
      const arr = getCascaderPath(value, Obj.children);
      if (arr.length > 0) {
        result.push(...arr);
      } else {
        result.pop();
      }
    } else {
      result.pop();
    }
  }
  return result;
}